<?php function tf_postcontainer_preview($thisTemplate, $body_class) {
  global $thfr_css;

  $thisCon = $thfr_css[$thisTemplate]['usepostcontainer'];
  extract($thfr_css['postcontainers'][$thisCon]);

  $headlinecode = tf_get_template_post_headlinecode_example();
  if (in_array($thisTemplate, array('index', 'category', 'archive'))) {
    $headlinecode = str_ireplace(array('h1'), array('h2'), $headlinecode);
  }

  $aContents = array(
    'post_class' => ' class="post"',
    'post_selector' => ' selector="div.post"',
    'post_id' => ' id="post-<?php the_ID(); ?>"',
    'kickercheck' => $kickercheck,
    'kicker_selector' => ' selector="div.post-kicker"',
    'kickercode' => tf_get_template_post_kickercode_example(),
    'headlinecheck' => $headlinecheck,
    'headline_selector' => ' selector="div.post-headline"',
    'headlinecode' => $headlinecode,
    'bylinecheck' => $bylinecheck,
    'byline_selector' => ' selector="div.post-byline"',
    'bylinecode' => tf_get_template_post_bylinecode_example(),
    'contentcheck' => $contentcheck,
    'content_selector' => ' selector="div.post-bodycopy"',
    'content_class' => ' class="post-bodycopy"',
    'contenttype' => $contenttype,
    'the_excerpt' => tf_get_template_post_the_excerpt_example(),
    'thecontent' => tf_get_template_post_thecontent_example(),
//    'linkpages' => $linkpages,
    'footercheck' => $footercheck,
    'footer_selector' => ' selector="div.post-footer"',
    'footercode' => tf_get_template_post_footercode_example(),
    'drop_area_beforePostTitle' => tf_drop_area($thisTemplate, "beforePostTitle", $body_class),
    'drop_area_beforePost' => tf_drop_area($thisTemplate, "beforePost", $body_class),
    'drop_area_afterPostTitle' => tf_drop_area($thisTemplate, "afterPostTitle", $body_class),
    'drop_area_afterPost' => tf_drop_area($thisTemplate, "afterPost", $body_class),
  );
  $string = tf_common_template_postcontainer_section($aContents);

  if ($thumbcheck == 'on') {
    // Add Thumb Code:
    if ($thumbalign != 'none') {
      $thumbcss = " align$thumbalign";
    }
    $thumbcode = '<img src="/images/postthumb.gif" class="postthumb' . $thumbcss . '" selector="img.postthumb" />' . tf_drop_area($thisTemplate, "afterThumbnail", $body_class);
    $thumbreplace = '%thumbpos-' . $thumbpos . '%';
    $string = str_replace($thumbreplace, $thumbcode, $string);
  }

  // Remove remaining Thumb placeholders
  $string = preg_replace("/%thumbpos-(.*)%/i", "", $string);
  $string = str_replace('selector="', 'selector="' . $body_class, $string);

  return $string;
}

?>